package dongshi.daddy.main;

import com.alibaba.dubbo.config.RegistryConfig;
import dongshi.daddy.service.multipleexternalconfig.MyMultipleExternalConfigConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

public class ProviderWithMultipleExternlConfigMain {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(MyMultipleExternalConfigConfiguration.class);
        context.refresh();
        /*dubbo.applications.applicationBean.name = dubbo-demo-application
        dubbo.applications.applicationBean2.name = dubbo-demo-application2
        dubbo.applications.applicationBean3.name = dubbo-demo-application3
        */
        System.out.println(context.getBean("zkBean1", RegistryConfig.class));
        System.out.println(context.getBean("zkBean2", RegistryConfig.class));
        // 主进程不退出
        System.in.read();
    }
}
